<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   template="../WEB-INF/shared/masterlayout.xhtml"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:c="http://java.sun.com/jsp/jstl/core"
   xmlns:h="http://java.sun.com/jsf/html">
  <ui:define name="leftCol">
    <ui:include src="components/leftCol.xhtml"/>
  </ui:define>
  <ui:define name="rightCol">
      <h1>Administrera resmal</h1>
      #{ManageDestinationBean.listAllDestinations()}
      <table class="manageTable">
        <thead>
            <tr>
                <td>Namn</td>
                <td>Geo X</td>
                <td>Geo Y</td>
                <td>Image</td>
                <td>Radera</td>
            </tr>
        </thead>
        <h:form>
        <tbody>
        <ui:repeat var="destination" value="#{ManageDestinationModel.getAllDestinations()}">
                <tr>
                    <td><h:outputText value="#{destination.name}"/></td>
                    <td><h:outputText value="#{destination.geox}"/></td>
                    <td><h:outputText value="#{destination.geoy}"/></td>
                    <td><h:outputText value="#{destination.image}"/></td>
                    <td><h:commandLink value="Radera" action="#{ManageDestinationController.removeDestination}">
                        <f:setPropertyActionListener target="#{ManageDestinationController.selectedDestinationName}" value="#{destination.name}" />
                    </h:commandLink></td>
                </tr>
            </ui:repeat>
        </tbody>
        </h:form>
      </table>
  </ui:define>
</ui:composition>